﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UI
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void Menu_Click(object sender, EventArgs e)
        {
            //FormUtil.
            // 通过switch 判断打开窗口
            switch (sender.ToString())
            {
                // 员工管理
                case FormUtil.EMPLOYEE_FORM:
                    {
                        var employee = FormUtil.getEmployeeForm();
                        employee.Show();
                        break;
                    }

                // 部门管理
                case FormUtil.DEPARTMENT_FORM:
                    {
                        var department = FormUtil.getDepartmentForm();
                        department.Show();
                        break;
                    }
                // 管理员设置
                case FormUtil.MANAGER_SET_FORM:
                    {
                        var manager = FormUtil.getManagerForm();
                        manager.Show();
                        break;
                    }
            }
        }

        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(0);
        }
    }
}
